home *** CD-ROM | disk | FTP | other *** search
- Path: rcp6.elan.af.mil!rscernix!danpop
- From: danpop@mail.cern.ch (Dan Pop)
- Newsgroups: comp.lang.c,comp.lang.c++
- Subject: Re: Why is C faster than FORTRAN?
- Date: 13 Mar 96 17:31:07 GMT
- Organization: CERN European Lab for Particle Physics
- Message-ID: <danpop.826738267@rscernix>
- References: <4hv2ho$d8t@news.interpath.net> <4i2c5e$t70@kiwi.futuris.net> <4i4poj$j7e@thorn.cc.usm.edu>
- NNTP-Posting-Host: ues5.cern.ch
- X-Newsreader: NN version 6.5.0 #7 (NOV)
-
- In <4i4poj$j7e@thorn.cc.usm.edu> sakalauk@coam.usm.edu (Peter Sakalaukus) writes:
-
- >I have two programs, FORTRAN and C. They both use the same algorithm to
- >manipulate numeric data. The larger the data file though, the faster the
- >C version is, (in relation to the FORTARN program). I am running on a UNIX
- >platform.
- >
- >My question is: what is the reason that C is so much quicker?
-
- Without seeing your code, nobody can tell. Are you sure you've used
- comparable optimization levels? Are the programs CPU or I/O bound?
-
- >Is C normally faster than FORTRAN?
-
- No. Fortran is normally faster than C. Fortran forbids data aliasing
- (behind compiler's back) and this allows more aggressive optimization,
- especially on code involving arrays.
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-